/**
 * @author 艾尼亚尔
 * @date 2025/8/18
 * @description
 */
import type {AxiosRequestConfig, AxiosResponse} from 'axios';
import type {Result, CreateAxiosOptions} from './help.ts';

export abstract class AxiosTransform {
  /**
   * @description: 请求之前处理配置
   */
  beforeRequestHook?: (config: AxiosRequestConfig, options: CreateAxiosOptions) => AxiosRequestConfig;
  /**
   * @description: 请求之前的拦截器
   */
  requestInterceptors?: (config: AxiosRequestConfig, options: CreateAxiosOptions) => AxiosRequestConfig;
  /**
   * @description: 请求成功处理
   */
  transformResponseData?: <T>(res: AxiosResponse<Result<T>>,options: CreateAxiosOptions) => Result<T>;

  /**
   * @description: 请求之后的拦截器
   */
  responseInterceptors?: (res: AxiosResponse) => AxiosResponse;

  /**
   * @description: 请求之后的拦截器错误处理
   */
  responseInterceptorsCatch?: (error: Error) => void;

}

